package cn.iocoder.yudao.module.voice.cc.config;
import cn.iocoder.yudao.module.voice.cc.mq.RocketMQMessageConsumer;
import cn.iocoder.yudao.module.voice.cc.mq.RocketMQVoiceMessageSender;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RocketMqMessageConfiguration {

    @Bean
    public RocketMQVoiceMessageSender rocketMQWebSocketMessageSender(
            RocketMQTemplate rocketMQTemplate,
            @Value("${yudao.websocket.sender-rocketmq.topic}") String topic) {
        return new RocketMQVoiceMessageSender(rocketMQTemplate, topic);
    }

    @Bean
    public RocketMQMessageConsumer rocketMQWebSocketMessageConsumer() {
        return new RocketMQMessageConsumer();
    }

}
